﻿<UserControl 
    x:Class="BadHabit.Factory.Controls.BurnDownGraph"    
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"             
    
    xmlns:props="clr-namespace:BadHabit.Factory.Properties"
    x:Name="burnDownGraphControl"
    
    SizeChanged="UserControl_SizeChanged"    
    HorizontalAlignment="Left"
    VerticalAlignment="Top"
    >
    <UserControl.Resources>

        <LinearGradientBrush x:Key="AreaBrush" StartPoint="0,0" EndPoint="0,1"  >
            <GradientStop Color="{StaticResource NormalColor}" Offset="0"/>
            <GradientStop Color="{StaticResource DarkColor}" Offset="0.6"/>
        </LinearGradientBrush>

        <SolidColorBrush x:Key="AreaBorderBrush" Color="{StaticResource DarkColor}" />
        
        
        
        <LinearGradientBrush x:Key="ToDoBrush" StartPoint="0,0.5" EndPoint="1,0.5"  >
            <GradientStop Color="#820909" Offset="0"/>
            <GradientStop Color="#d47777" Offset="0.4"/>
        </LinearGradientBrush>        
        <SolidColorBrush x:Key="ToDoBorderBrush" Color="#820909"/>

        <LinearGradientBrush x:Key="WorkingBrush" StartPoint="0,0.5" EndPoint="1,0.5">
            <GradientStop Color="#d7aa0e" Offset="0"/>
            <GradientStop Color="#f3d775" Offset="0.4"/>
        </LinearGradientBrush>
        <SolidColorBrush x:Key="WorkingBorderBrush" Color="#d7aa0e"/>

        <SolidColorBrush x:Key="DoneBrush" Color="Transparent"/> 
            

        <SolidColorBrush x:Key="DoneBorderBrush" Color="Transparent"/>
        
        <SolidColorBrush x:Key="CurrentDayBrush" Color="{StaticResource DarkColor}"/>
        
        
        <SolidColorBrush x:Key="PlanLineBrush" Color="Red"/>

    </UserControl.Resources>


    

    <!-- MAIN CONTENT -->
        <Grid           
            x:Name="ContentGrid"             
            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"            
            >
            <Grid.ColumnDefinitions>
                <ColumnDefinition x:Name="YAxisColumn" Width="0.05*"/>
                <ColumnDefinition Width="0.03*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition x:Name="DayScale" Height="0.12*" />
                <RowDefinition x:Name="XAxisRow" Height="0.06*" />
            </Grid.RowDefinitions>
            
            

            <!-- XAXIS TITLE -->
            <Viewbox Grid.ColumnSpan="3" Grid.Row="2">
                <TextBlock x:Name="XAxisTitle" Text="{x:Static props:Resources.days}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,2,0,2" />
            </Viewbox>

            <!-- YAXIS TITLE -->
            <Viewbox Grid.Column="0" Grid.RowSpan="2">
                <TextBlock x:Name="YAxisTitle" Text="{x:Static props:Resources.To_Do_hrs}"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       Margin="0,2,8,2"                       
                       >
                <TextBlock.LayoutTransform>
                    <RotateTransform Angle="-90" />
                </TextBlock.LayoutTransform>
                </TextBlock>
            </Viewbox>
            
            <!-- YAXIS SCALE -->
            <Canvas x:Name="YAxisScalePanel"
                        Grid.Column="1" Grid.RowSpan="3"
                        />


        <Border Grid.Column="2" Grid.Row="0"
                BorderThickness="1,0,0,1"
                BorderBrush="Gray"
                HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"    >
            <!-- GRAPH -->
            <Canvas x:Name="GraphPanel"                                            
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"    
                        ClipToBounds="True"/>

        </Border>
                

            <!-- DAY SCALE -->
            <StackPanel x:Name="DayScalePanel"
                        Grid.Column="2" Grid.Row="1"                    
                        Orientation="Horizontal"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"                       
                       />

        <TextBlock x:Name="ErrorMessagetextBlock" Grid.Column="2" Grid.Row="0" Visibility="Hidden" HorizontalAlignment="Center" Foreground="Red" />

    </Grid>


</UserControl>
